package com.davies.learn.jbv.domain.dto;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @author davies
 * @date 2022/2/19 2:25 PM
 */
@Data
@AllArgsConstructor

@Accessors(chain = true)
public class ErrorResponseDTO {

    private LocalDateTime timestamp;


    private String message;

    private String code;

    private Object data;

    public ErrorResponseDTO() {
        this.timestamp = LocalDateTime.now();
    }

    public ErrorResponseDTO(String code) {
        this();
        this.code = code;
    }


    public ErrorResponseDTO(String code, String message, Object data) {
        this(code);
        this.message = message;

        this.data = data;
    }

}
